function indexObject(enterpriseId,uid,datas,countItems,showItems){
    this.enterpriseId = enterpriseId;
    this.uid = uid;
    this.homeData = datas;
    this.countItmes = countItems;
    this.showItems = showItems;
    this.now = new Date();
    var Mounth = this.now.getMonth()+1;
    if(Mounth<10){
        Mounth = '0'+Mounth;
    }else{
        Mounth = Mounth;
    }
    var day = this.now.getDate();
    var today = this.now.getFullYear()+'-'+Mounth+'-'+day;
    this.toady = today;
}
indexObject.prototype.getIndexItems = function(timeType){
    var enterpriseId = this.enterpriseId;
    var uid          = this.uid;
    var timeType     = timeType;
    return  this.actionAjax(timeType);
    //return this.callback()(); 调用函数内部的匿名函数
}
indexObject.prototype.actionAjax = function(type){
    var items = {};
    var datas = this.homeData;
    var countItems = this.countItmes;
    var showView = this.showItems;
    //console.log(showView);
    var orderCount=[],orderTime = [],rightCount = {},productItmes={};
    switch (type){
        case 'today'://今天
            var maxLength = showView.today.titleX.length;
            items.title     ='订单统计折线图('+showView.today.titleX[0]+'~'+showView.today.titleX[maxLength-1]+')';//开始时间，到结束时间
            items.timesX    = showView.today.titleX;
            items.orderY    = showView.today.priceY;
            rightCount.today = countItems.today;
            items.rgihtItems = rightCount;
            break;
        case 'week':
            //console.log(showView);
            var maxLength = showView.week.titleX.length;
            items.title     ='订单统计折线图('+showView.week.titleX[0]+'~'+showView.week.titleX[maxLength-1]+')';//开始时间，到结束时间
            items.timesX    = showView.week.titleX;
            items.orderY    = showView.week.priceY;
            rightCount.week = countItems.week;
            items.rgihtItems = rightCount;
            break;
        case 'mounth':
            //alert(JSON.stringify(showView));
            var maxLength = showView.mouth.titleX.length;
            items.title     ='订单统计折线图('+showView.mouth.titleX[0]+'~'+showView.mouth.titleX[maxLength-1]+')';//开始时间，到结束时间
            items.timesX    = showView.mouth.titleX;
            items.orderY    = showView.mouth.priceY;
            rightCount.mounth = countItems.mounth;
            items.rgihtItems = rightCount;
            break;
    }
    productItmes.channel = datas.channel;
    productItmes.customer = datas.customer;
    productItmes.product = datas.product;
    productItmes.territory = datas.territory;
    productItmes.readyorder = datas.processing_order;
    items.countItmes = productItmes;
    return items;
}
indexObject.prototype.callback=function(){
    return function aaa(){
        return '这里是测试的数据';
    }
}
indexObject.prototype.getTimesWeek = function(){
    var now = new Date();
    var weeks =  now.getDay();
    if(weeks==0){
        var week = 7;
    }else{
        var week =  now.getDay();  //获取当前星期X(0-6,0代表星期天)
    }
    var dateTmp = [];
    var dateItmes = {};
    for(var i=1;i<=week;i++){
        var date = new Date(now.getTime() - i * 24 * 3600 * 1000);
        var toMouth = date.getMonth()+1;
        if(toMouth<=10){
            var toMouths = '0'+toMouth;
        }else{
            var toMouths =toMouth;
        }
        var day = date.getDate();
        dateTmp.push(date.getFullYear()+'-'+(toMouths)+'-'+day);
    }
    return dateTmp;
}